﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;

namespace helpcarla
{
    public partial class frmEmailInfo : Form
    {
        public frmEmailInfo()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSendEmail_Click(object sender, EventArgs e)
        {
            try
            {
                SmtpClient smtp = new SmtpClient("smtp.1and1.com");
                MailMessage message = new MailMessage("mailer@imaslog.com", txtEmail.Text);
                message.Subject = "Medical Info for Carla Rechtzigel";
                //message.Attachments.Add();
                message.Body = "This message was sent using the Carla Healer 1.2.3 program.";
                System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("mailer@imaslog.com", "xESp3maheh3#a?EVuthu+EchafApr!?4&ruf=-juPhumamusta=r6fA?7@aP+&=!");
                smtp.Credentials = credentials;
                smtp.Send(message);
            }
            catch (SmtpException smtpex)
            {
                MessageBox.Show("An error occurred while sending feedback: " + smtpex.Message);
            }
            MessageBox.Show("Your medical info has been sent to " + txtName.Text);
            this.Close();
        }
    }
}
